import 'package:flutter/material.dart';

class MyApp10 extends StatelessWidget {
  const MyApp10({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('弹性布局Expanded的使用'),
          backgroundColor: Colors.red,
          centerTitle: true,
        ),
        body: Center(
          child: Container(
            width: MediaQuery.of(context).size.width,
            height: 100,
            color: Color.fromARGB(255, 245, 234, 203),
            child: Row(
              children: [
                Expanded(
                    flex: 1,
                    child: Container(
                      height: 40,
                      color: Colors.amber,
                      child: const Text('1111111'),
                    )),
                Expanded(
                    flex: 3,
                    child: Container(
                      height: 40,
                      color: const Color.fromARGB(255, 168, 221, 245),
                      child: const Text('222222222'),
                    )),
                Expanded(
                    flex: 1,
                    child: Container(
                      height: 40,
                      color: const Color.fromARGB(255, 188, 245, 185),
                      child: const Text('33333333'),
                    ))
              ],
            ),
          ),
        ));
  }
}
